#include<stdio.h>
int main()
{
	int sum = 0, number;
	scanf_s("%d", &number);
	while (number)
	{
		sum += number%10;
		number = number / 10;  
	}
	printf("%d", sum);
	return 0;
}